#ifndef IMAGEBUTTON_H
#define IMAGEBUTTON_H

#include <e32std.h>
#include <e32base.h>
#include <gdi.h>

class Context;
class CGraphicsProxy;

class CImageButton : public CBase
	{
	class OnZoomClickListener 
		{
	public:
		virtual void OnZoomClick(int id) = 0;
		}

private:
	int 					id;
	int 					left;
	int 					top;
	int 					width;
	int 					height;

	CFbsBitmap* 			mCurrBmp;
	CFbsBitmap* 			mDownBmp;
	CFbsBitmap* 			mDefaultBmp;
	CFbsBitmap* 			mDisableBmp;

	Context& 				mContext;
	TBool 					isDown;
	TBool 					isEnable;
	OnZoomClickListener* 	mListener;
	
public:
	~CImageButton();
	CImageButton(Context& context);
	void SetOnClickListener(OnZoomClickListener& listener);
	void SetBitmap(CFbsBitmap* defaultBmp, CFbsBitmap* downBmp, CFbsBitmap* disableBmp);
	void SetEnabled(TBool flag);
	void SetXY(float x, float y);
	void OnDraw(CGraphicsProxy& canvas)
	int GetId() const;
	void SetId(int id);
	TBool OnTouchEvent(const MotionEvent& event);

	};

#endif // IMAGEBUTTON_H
